"""
-------------------------------------------
@ File          : fibonacci.py
@ Version       : V 0.1
@ time          : 2020-3-19  19:53
@ Tool          ：PyCharm
@ Author        ：Haomingju
@ Email         : haomingju @ gmail.com
@ Description   : 输出斐波那契数列
-------------------------------------------
"""

# 循环算法实现

fib1, fib2 = 1, 1

for i in range(101):
    print("FIB({}) = {}".format(i + 1, fib1))
    fib1, fib2 = fib2, fib1 + fib2


# ---------------------------------------------------------------------
# 列表方法实现
numbers = int(input("Please input the number item: "))

fib = [0, 1]

for i in range(2, numbers + 1):
    fib.append(fib[i - 1] + fib[i - 2])

for i in range(1, numbers + 1):
    print("FIB({}) = {}".format(i, fib[i]))
